package com.ikingtech.platform.service.system.dept.configuration;

import com.ikingtech.framework.sdk.component.api.CompDepartmentApi;
import com.ikingtech.framework.sdk.department.api.DeptOrgApi;
import com.ikingtech.platform.service.system.dept.service.CompDepartmentService;
import com.ikingtech.platform.service.system.dept.service.DeptService;
import com.ikingtech.platform.service.system.dept.service.ModelConverter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author tie yan
 */
@Configuration
public class CompDepartmentConfiguration {

    @Bean
    @ConditionalOnMissingBean({CompDepartmentApi.class})
    public CompDepartmentApi compDepartmentApi(DeptService service, DeptOrgApi deptOrgApi, ModelConverter converter) {
        return new CompDepartmentService(service, deptOrgApi, converter);
    }
}
